﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;



namespace ProjectPigs.Util
{
    class FPSCounter
    {
        static int fpsDisplay = 0;
        static int fpsCount = 0;
        static Timer timer = new Timer(1000L);
        static Boolean ab = true;

        public static void drawFrame(SpriteBatch sb, GameTime gameTime)
        {
            fpsCount++;

            if (timer.repeat(gameTime))
            {
                fpsDisplay = fpsCount;
                fpsCount = 0;

                if (fpsDisplay < 60 && ab)
                {
                    Console.WriteLine("Elapsed game time: " + gameTime.ElapsedGameTime);

                }
            }

            Debug.setEntry("FPS " + fpsDisplay, 0, 2);

        }

    }
}
